package com.whut.consumer.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import sun.rmi.runtime.Log;

/**
 * @author WZH
 * @create 2021-08-27 10:22
 * @desc 消费者监听
 **/
@Component
@RocketMQMessageListener(topic = "DATA_WD",consumerGroup = "my-consumer-group")
@Slf4j
public class ConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info(message);
//        try {
//            Thread.sleep(10 * 1000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }

    }
}
